package com.cjq.mall.wallet.mapper;

import com.cjq.mall.wallet.pojo.entity.BusinessDetail;
import com.cjq.mall.wallet.pojo.vo.BusinessDetailVO;
import org.apache.ibatis.annotations.Param;
import org.apache.tomcat.jni.Local;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface BusinessDetailMapper {

    /**
     * 新增交易明细
     * @param businessDetail
     * @return
     */
    int saveBusinessDetail(BusinessDetail businessDetail);

    /**
     * 根据用户id查询交易明细
     * @param userId
     * @return
     */
    List<BusinessDetailVO> selectBusinessDetailByUesrId(@Param("userId") Long userId);

    /**
     * 根据用户id查询指定时间段内的交易明细
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    List<BusinessDetailVO> selectBusinessDetailByTime(@Param("userId") Long userId,
                                                      @Param("startTime") LocalDateTime startTime,
                                                      @Param("endTime") LocalDateTime endTime);
}
